import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'home',
    component: () => import('../views/home/Home.vue'),
    children: [
      {
        path: '/role',
        name: 'role',
        component: () => import('../views/role/Role.vue'),
      },
      {
        path: '/user',
        name: 'user',
        component: () => import('../views/user/User.vue'),
      },
      {
        path: '/area',
        name: 'area',
        component: () => import('../views/area/Area.vue'),
      },
      {
        path: '/estate',
        name: 'estate',
        component: () => import('../views/estate/Estate.vue'),
      },
    ],
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login/Login.vue'),
  },

];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
});

export default router;
